//
//  JYJVCOfFeaturedTopThreeDetails.m
//  HappyListen
//
//  Created by 冀永金 on 16/8/31.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "JYJVCOfFeaturedTopThreeDetails.h"
#import "BaseTableView.h"
#import "JYJTAMacro.h"
#import "JYJFeaturedDetailsTableHeadView.h"
#import "BaseCollectionView.h"
#import "JYJFeaturedDetailsSmallCollectionCell.h"
#import "JYJProgramTableViewCell.h"
#import "MJRefresh.h"
#import "UMSocial.h"

#import "JYJBannerListModel.h"
#import "JYJBestItemsModel.h"
#import "JYJNetWorkParser.h"
#import "JYJProgramModel.h"
#import "UIView+Frame.h"
#import "JYJEventListModel.h"
#import "JYJAnchorColumnModel.h"
#import "JYJColumnListModel.h"
#import "JYJTwoSegmentModel.h"
#import "JYJTwoSegmentModelTwo.h"
#import "JYJMusicPlayerViewController.h"
#import "JYJDataTools.h"
#import "JYJProgramListModel.h"
#import "JYJProgramListSecondModel.h"
#import "JYJMusicsContentModel.h"
#import "JYJSeachModelOne.h"
#import "JYJSeachModelTwo.h"
#import "JYJSeachProgramModelOne.h"
#import "JYJSeachProgramModelTwo.h"
#import "JYJMusicMiniView.h"
#import "UIImageView+WebCache.h"
#import "JYJVCOfMine.h"
#import "JYJMusicManager.h"
@interface JYJVCOfFeaturedTopThreeDetails ()<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,UMSocialUIDelegate>
@property (nonatomic, strong) BaseTableView *tableView;
@property (nonatomic, strong) BaseCollectionView *smallCollection;
@property (nonatomic, strong) UIView *redView;
@property (nonatomic, strong) NSMutableArray  *marrOfModel;
@property (nonatomic, strong) BaseLabel *labelOfProgram;
@property (nonatomic, strong) BaseView *headView;
@property (nonatomic, strong) UIImageView *imageOfAnimation;
@property (nonatomic, strong) NSDictionary *infoDic;
@property (nonatomic, assign) NSInteger count;
@property (nonatomic, strong) NSDictionary *dic1;
@end

@implementation JYJVCOfFeaturedTopThreeDetails

- (void)viewDidLoad {
    [super viewDidLoad];
    self.count = 1;
    [self createTableView];
    [self createHeadVivew];
    self.view.backgroundColor = [UIColor colorWithRed:0.07 green:0.07 blue:0.08 alpha:1.00];
    [self createSmallCollection];
    [self createAnimation];
    self.navigationItem.leftBarButtonItem  =[[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"fanhui"] style:UIBarButtonItemStylePlain target:self action:@selector(Back)];
    // 判断传进来modle
    if (self.cycleImageModel) {
        self.navigationItem.title = self.cycleImageModel.content_title;
    }else if (self.itemsModel) {
        self.navigationItem.title = self.itemsModel.item_name;
    }else if (self.eventModel){
        self.navigationItem.title = self.eventModel.content_title;
    }else if (self.columnModel) {
       
        self.navigationItem.title = self.columnModel.item_name;
    }else if (self.columnListModel) {
        self.navigationItem.title = self.columnListModel.item_name;
    }else if (self.segmentModel) {
        self.navigationItem.title = self.segmentModel.item_name;
    
    }else if(self.segmentModelTwo) {
        self.navigationItem.title = self.segmentModelTwo.item_name;
    }else if (self.programListModel) {
        self.navigationItem.title = self.programListModel.music_title;
    }else if (self.programListModelTwo) {
        self.navigationItem.title = self.programListModelTwo.music_title;
    }else if (self.musicsContentModel){
        self.navigationItem.title = self.musicsContentModel.music_title;
    }else if (self.seachModelOne) {
        self.navigationItem.title = self.seachModelOne.item_name;
    }else if (self.seachModelTwo){
        self.navigationItem.title = self.seachModelTwo.item_name;
    }else if (self.seachProgramModelOne) {
        self.navigationItem.title = self.seachProgramModelOne.music_title;
    }else {
        self.navigationItem.title = self.seachProgramModelTwo.music_title;
    }
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc]initWithTitle:@"分享" style:UIBarButtonItemStylePlain target:self action:@selector(handleShare)];
    [self handleData];
   
      // Do any additional setup after loading the view.
}
- (void)Back{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark ----------判断传进来的数据
- (void)handleData {
    if (self.cycleImageModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.cycleImageModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
        }];
        
        }else if (self.itemsModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.itemsModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
            
            [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
                self.marrOfModel = array;
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self.tableView reloadData];
                    self.imageOfAnimation.hidden = YES;
                });

            }];
            

    }else if (self.eventModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.eventModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });

        }];
        
    }else if (self.columnModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            

        }];
        
    }else if (self.columnListModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            

        }];
       
    }else if (self.segmentModel ){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            

        }];
    
    }else if (self.segmentModelTwo) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            

        }];
        
    }else if (self.programListModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
            
        }];

    }else if (self.programListModelTwo) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
            
        }];

    }else if (self.musicsContentModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.musicsContentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
            
        }];

    }else if (self.seachModelOne) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
            
        }];

    }else if (self.seachModelTwo){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
      }];

    }else if (self.seachProgramModelOne){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
        }];

    }else {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [[JYJDataTools shareDataTools]postDataWithURL:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string passValue:^(NSArray __kindof *array) {
            self.marrOfModel = array;
            dispatch_async(dispatch_get_main_queue(), ^{
                [self.tableView reloadData];
                self.imageOfAnimation.hidden = YES;
            });
            
        }];

    }

   
}
#pragma mark---------创建的头式图  和 判断头式图的数据
- (void)createHeadVivew {
    JYJFeaturedDetailsTableHeadView *head = [[JYJFeaturedDetailsTableHeadView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)];
    self.tableView.tableHeaderView = head;
    
    if (self.cycleImageModel) {
        head.cycleImageModel = self.cycleImageModel;
    }else if (self.itemsModel){
        head.itemsModel = self.itemsModel;
    }else if (self.eventModel) {
        head.eventModel = self.eventModel;
    }else if (self.columnModel){
        head.columnModel = self.columnModel;
    }else if (self.columnListModel){
        head.columnListModel = self.columnListModel;
    }else if (self.segmentModel) {
        head.segmentModel = self.segmentModel;
    }else if (self.segmentModelTwo) {
        head.segmentModelTwo = self.segmentModelTwo;
    }else if (self.programListModel) {
        head.programListModel = self.programListModel;
    }else if (self.programListModelTwo) {
        head.programListModelTwo = self.programListModelTwo;
    }else if (self.musicsContentModel) {
        head.musicsContentModel = self.musicsContentModel;
    }else if (self.seachModelOne) {
        head.seachModelOne = self.seachModelOne;
    }else if (self.seachModelTwo){
        head.seachModelTwo = self.seachModelTwo;
    }else if (self.seachProgramModelOne) {
        head.seachProgramModelOne = self.seachProgramModelOne;
    }else {
        head.seachProgramModelTwo = self.seachProgramModelTwo;
    }
    head.backgroundColor = [UIColor colorWithRed:0.07 green:0.07 blue:0.08 alpha:1.00];
    
   

}
- (void)createTableView {
    self.tableView = [[BaseTableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    [self.view addSubview:_tableView];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.tableView registerClass:[JYJProgramTableViewCell class] forCellReuseIdentifier:@"pool"];
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.separatorStyle =  UITableViewCellSeparatorStyleNone;
    self.tableView.backgroundColor = [UIColor colorWithRed:0.07 green:0.07 blue:0.08 alpha:1.00];
    self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
    
}
#pragma mark-----------加载
- (void)loadMoreData {
    if (self.cycleImageModel) {
          self.count += 1;
            NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
            NSString *string = [NSString stringWithFormat:@"%@",self.cycleImageModel.item_id];
            NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
            NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
            NSString *str5 = @"%7D%7D";
            string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
      [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
          
          if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
              
              NSArray *dataArray = [result objectForKey:@"data"];
              for (NSDictionary *dic in dataArray) {
                  JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                  [self.marrOfModel addObject:model];
              }
              [self.tableView reloadData];
              
          }
      } andFailureBlock:^(NSError *error) {
          
      }];
        [self.tableView.mj_footer endRefreshing];
      
    }else if (self.itemsModel){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.itemsModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else if (self.eventModel){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.eventModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
       
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];

        
    }else if (self.columnModel) {
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else if (self.columnListModel) {
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    
    }else if (self.segmentModel ){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
       
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else if (self.segmentModelTwo) {
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
       
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else if (self.programListModel){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
      
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
    
    }else if (self.programListModelTwo) {
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        

    }else if (self.musicsContentModel){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.musicsContentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else if (self.seachModelOne) {
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
    
    }else if (self.seachModelTwo){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
        
    }else if (self.seachProgramModelOne){
        self.count += 1;
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }
        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }else {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A";
        NSString *str4 = [NSString stringWithFormat:@"%ld",self.count];
        NSString *str5 = @"%7D%7D";
        string = [[[[str1 stringByAppendingString:string] stringByAppendingString:str3] stringByAppendingString:str4] stringByAppendingString:str5];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            if (![result[@"paginated"][@"more"] isEqualToString:@"0"]) {
                NSArray *dataArray = [result objectForKey:@"data"];
                for (NSDictionary *dic in dataArray) {
                    JYJProgramModel*model = [JYJProgramModel modelWithDic:dic];
                    [self.marrOfModel addObject:model];
                }
                [self.tableView reloadData];
                
            }

        } andFailureBlock:^(NSError *error) {
            
        }];
        [self.tableView.mj_footer endRefreshing];
        
    }

}
- (void)createSmallCollection {
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
    layout.itemSize = CGSizeMake(SCREEN_WIDTH / 2, 47);
    layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
    layout.minimumInteritemSpacing = 0;
    self.smallCollection = [[BaseCollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 47) collectionViewLayout:layout];
    [self.headView addSubview:_smallCollection];
    self.smallCollection.delegate = self;
    self.smallCollection.dataSource = self;
    [self.smallCollection registerClass:[JYJFeaturedDetailsSmallCollectionCell class] forCellWithReuseIdentifier:@"Small"];
    self.redView = [[UIView alloc]initWithFrame:CGRectMake(0, 47, SCREEN_WIDTH / 2, 3)];
    [self.headView addSubview:_redView];
    _redView.backgroundColor = [UIColor redColor];
    self.labelOfProgram = [[BaseLabel alloc]initWithFrame:CGRectMake(0, 53, 200, 30)];
    [self.headView addSubview:_labelOfProgram];
    _labelOfProgram.textColor = [UIColor whiteColor];
   
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.marrOfModel.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JYJProgramTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"pool" forIndexPath:indexPath];
    JYJProgramModel *model = self.marrOfModel[indexPath.row];
    [cell setProgramModel:model];
    return cell;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 90;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    self.headView = [[BaseView alloc]initWithFrame:CGRectMake(0, 200, SCREEN_WIDTH, 90)];
    [self.view addSubview:_headView];
    _headView.backgroundColor = [UIColor colorWithRed:0.17 green:0.18 blue:0.23 alpha:1.00];
    [self createSmallCollection];
    if (self.cycleImageModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.cycleImageModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *program = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",program];
        } andFailureBlock:^(NSError *error) {
            
        }];
    }else  if (self.itemsModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.itemsModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *program = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",program];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.eventModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233368%22%2C%22sid%22%3A%22d0f457f15aab43579fc6c37a4dce426c%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%@",self.eventModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string] stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *program = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",program];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.columnModel){
        NSString *str1 = @"json=%7B%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnModel.item_id];
        NSString *str3 = @"%22%2C%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/item.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"data"] objectForKey:@"item_musics"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];
        
    
    }else if (self.columnListModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.columnListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];
        
    }else if (self.segmentModel ){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.segmentModelTwo) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.segmentModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.programListModel) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.programListModelTwo){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.programListModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.musicsContentModel){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.musicsContentModel.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else if (self.seachModelOne) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];
        

    }else if (self.seachModelTwo){
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];
        

    }else if (self.seachProgramModelOne) {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelOne.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }else {
        NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%2233366%22%2C%22sid%22%3A%2216c79d7928f744d894fe9ddf43865f0b%22%7D%2C%22item_id%22%3A%22";
        NSString *string = [NSString stringWithFormat:@"%ld",self.seachProgramModelTwo.item_id];
        NSString *str3 = @"%22%2C%22keyword%22%3A%22%22%2C%22orderBy%22%3A2%2C%22recomm%22%3A0%2C%22pagination%22%3A%7B%22count%22%3A25%2C%22page%22%3A1%7D%7D";
        string = [[str1 stringByAppendingString:string]stringByAppendingString:str3];
        [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/channel/musiclist.jhtml" andBody:string andBodyStyle: JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
            NSString *programCount = [result[@"paginated"] objectForKey:@"total"];
            self.labelOfProgram.text = [NSString stringWithFormat:@"节目(%@)",programCount];
        } andFailureBlock:^(NSError *error) {
            
        }];

    }

    


    return self.headView;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    JYJFeaturedDetailsSmallCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Small" forIndexPath:indexPath];
    NSArray *arr = @[@"全部节目",@"批量下载"];
    cell.titleLabel.text = arr[indexPath.item];
    cell.titleLabel.textColor = [UIColor whiteColor];
    
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.item == 0) {
        self.redView.frame = CGRectMake(0, 47, SCREEN_WIDTH / 2, 3);
        
    }else {
        self.redView.frame = CGRectMake(SCREEN_WIDTH / 2, 47, SCREEN_WIDTH / 2, 3);
        
        
    }
}
#pragma mark---------生命周期
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
    self.hidesBottomBarWhenPushed = YES;
    [JYJMusicMiniView shareMiniView].hidden = YES;
    NSUserDefaults *usersDefaults = [NSUserDefaults standardUserDefaults];
    self.infoDic = [usersDefaults objectForKey:@"info"];
}

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [_tableView setEditing:editing animated:animated];
}
#pragma mark-----delegate
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleDelete;
}
#pragma mark------收藏   下载
- (nullable NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    JYJProgramModel *model = self.marrOfModel[indexPath.row];
    NSUserDefaults *userDeafults = [NSUserDefaults standardUserDefaults];
    NSString *name = [userDeafults objectForKey:@"userName"];    UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"收藏" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
        if (name != nil) {
            
            NSString *str1 = @"json=%7B%22session%22%3A%7B%22uid%22%3A%22";
            NSString *strUid = self.infoDic[@"session"][@"uid"];
            NSString *str2 = @"%22%2C%22sid%22%3A%22";
            NSString *strSid = self.infoDic[@"session"][@"sid"];
            NSString *str3 = @"%22%7D%2C%22content_ids%22%3A%22";
            NSString *str4 = [NSString stringWithFormat:@"%ld",model.music_id];
            NSString *str5 = @"%22%2C%22operate%22%3A1%7D";
            str1 = [[[[[[str1 stringByAppendingString:strUid]stringByAppendingString:str2]stringByAppendingString:strSid]stringByAppendingString:str3]stringByAppendingString:str4]stringByAppendingString:str5];
            [JYJNetWorkParser POST:@"http://www.aiyinsitanfm.com/mobile/content/proccollect.jhtml" andBody:str1 andBodyStyle:JYJBodyString andHeader:HEADDIC andResponse:JYJJSON andSuccessBlock:^(id result) {
                NSString *str = result[@"proclist"];
                if (str.length != 0) {
                UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"收藏成功" preferredStyle:UIAlertControllerStyleAlert];
                    [self presentViewController:alert animated:YES completion:nil];
                    [alert dismissViewControllerAnimated:YES completion:nil];
                }
                else {
                    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"已经收藏" preferredStyle:UIAlertControllerStyleAlert];
                    UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                        
                    }];
                    [alert addAction:action];
                    [self presentViewController:alert animated:YES completion:nil];
                   
                }
            } andFailureBlock:^(NSError *error) {
                
            }];
        }else {
            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"请登录后选择收藏" preferredStyle:UIAlertControllerStyleAlert];
            UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style: UIAlertActionStyleDefault  handler:^(UIAlertAction * _Nonnull action) {
                
            }];
            [alert addAction:action];
            [self presentViewController:alert animated:YES completion:nil];
        }
        
    }];
    UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"下载" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
        
        [[JYJMusicManager shared] startWithMusicModel:model];
    }];
//
    rowAction.backgroundColor = [UIColor clearColor];
    action1.backgroundColor = [UIColor clearColor];
    return @[rowAction,action1];
}

- (void)createAnimation {
    self.imageOfAnimation = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"main_load_0"]];
    self.imageOfAnimation.frame = CGRectMake(SCREEN_WIDTH / 2 - 30, 200, 80, 200);
    [self.view addSubview:_imageOfAnimation];
    NSMutableArray *marr = [NSMutableArray array];
    for (int i = 0; i < 5; i++) {
        NSString *imageName = [NSString stringWithFormat:@"main_load_%d",i];
        UIImage *image = [UIImage imageNamed:imageName];
        [marr addObject:image];
    }
    _imageOfAnimation.animationDuration = 1;
    _imageOfAnimation.animationImages  = marr;
    _imageOfAnimation.animationRepeatCount = 0;
    [ _imageOfAnimation startAnimating];
    
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    JYJMusicPlayerViewController *playerVC = [JYJMusicPlayerViewController shareMusicPlayerVC];
    JYJProgramModel *model = self.marrOfModel[indexPath.row];

    playerVC.programModel = model;
    playerVC.modelIndex = indexPath.row;
    self.tabBarController.tabBar.hidden = YES;
    self.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:playerVC animated:YES
     ];
    self.hidesBottomBarWhenPushed = NO;
    
}
// 分享
- (void)handleShare {
    [UMSocialSnsService presentSnsIconSheetView:self appKey:@"57d654c467e58eb356002a73" shareText:@"你要分享的文字:" shareImage:[UIImage imageNamed:@"icon.png"] shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToWechatSession,UMShareToWechatTimeline,UMShareToQzone,UMShareToQQ,UMShareToRenren,UMShareToDouban,UMShareToEmail,UMShareToSms,UMShareToFacebook,UMShareToTwitter, nil ] delegate:self];
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
